<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>系统控制台</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <%@include file="/comm/pub.inc" %>
    <script type="text/javascript">
    	function getMenusByRole(i){
    		var json;
    		$.ajax({
    			url:contextPath+"/action/system/menu/getRoleMenus?id=1",
    			async:false,
    			dataType:"json",
    			type:"get",
    			success:function(j){
    				json = 	j;
    			}
    		});
    		return json;
    	}
    	
    	
    	function loadChecked(){
    		var data = getMenusByRole(1);
    		if (NOT_EMPTY(data)){
    			var sb = [];
	    		for(var i=0;i<data.length;i++){
	    			sb.push(data[i].id+"");
	    		}
	    		mini.get('tree1').setValue(sb.join(','));
    		}
    	}
    	
    	function getChecks(){
			debug(mini.get('tree1').getValue());    	
    	}
    	
    	
    </script>
</head>
<body >   
	<button onclick="getChecks()" >得到选择</button>
	<ul id="tree1" class="mini-tree" 
			url="<%=contextPath %>/action/system/menu/query"
			style="width:200px;padding:5px;" 
	        showTreeIcon="true" textField="name" idField="id" parentField="parentId" resultAsTree="false" 
	        showCheckBox="true" onload="loadChecked" checkRecursive="true"
	        allowSelect="false" enableHotTrack="false" >
	</ul> 
</body>
<script type="text/javascript">
</script>
</html>